package com.xinqi.modules.databank.v2.mapper;

import com.xinqi.common.mybatis.data.repo.SuperMapper;
import com.xinqi.modules.databank.dto.rsp.StudentScoreResultDTO;
import com.xinqi.modules.databank.v2.domain.CourseResourceStudentLogEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 数据层
 *
 * @author: system
 * @date: 2023/03/15
 */
@Mapper
public interface CourseResourceStudentLogMapper extends SuperMapper<CourseResourceStudentLogEntity> {

    List<CourseResourceStudentLogEntity> listByContentId(@Param("contentId") Long contentId);

    BigDecimal selectAvgScore(@Param("contentId") Long contentId);

    BigDecimal selectHighestScore(@Param("contentId") Long contentId);

    BigDecimal selectLowestScore(@Param("contentId") Long contentId);

    List<StudentScoreResultDTO> selectStudentScoreList(@Param("contentId") Long contentId);

    BigDecimal selectProgress(@Param("contentId") Long contentId,@Param("studentId")  Long studentId);

    CourseResourceStudentLogEntity selectStudentLogEntity(@Param("contentId") Long contentId,@Param("studentId") Long studentId);

    Integer selectStudyStatus(@Param("contentId") Long contentId,@Param("studentId") Long studentId);

    Integer selectIsRead(@Param("contentId") Long contentId,@Param("studentId") Long studentId);

    List<CourseResourceStudentLogEntity> selectNotEndings(@Param("classId") Long classId, @Param("studentId") Long studentId);

    int deletePhyById(@Param("id") Long id);

    int deleteLogByContentId(@Param("contentId") Long contentId);

    List<CourseResourceStudentLogEntity> selectVideoStudents(@Param("contentId") Long contentId, @Param("studentId") Long studentId);

}
